<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>软著航班信息页面</title>
	</head>
	<link rel="stylesheet" href="css/common.css" />
	<style>
		
		.head{
			width:1000px;	
			height:16vh;		
			margin:0 auto;	
			background: url(img/registerImg/logo.png) no-repeat left center;	
			position:relative;
		}
		.register{
			float:right;
			line-height:16vh;
		}
		.register .picfont{
			display: inline-block;
			width:15px;
			height:15px;
			background: url(img/registerImg/register.png) no-repeat left bottom;
		}
		section{
			background:#00aa98;			
		}
		.content{
			height:74vh;
			width:1000px;
			margin:0 auto;	
			background: url(img/registerImg/banner.png) no-repeat;		
		}
		footer{
			height:10vh;
		}
		footer p{
			font-size: 16px;			
			text-align: center;
			padding-top:3vh;
		}
		.text{
			float:left;
			margin-left:170px;
			color:#00aa98;
			font-size:18px;
			font-weight: 900;
			margin-top:3vh;
		}
		.winRegister{
			width:300px;
			height:300px;
			background:#dadada;
			float:right;
			margin-top:10vh;
			border-radius: 10px;
		}
		.userLogin{
			height:50px;
			font-size: 18px;
			text-align: center;
			padding-top:30px;
		}
		.user,.pw{
			height:40px;
			width:205px;
			margin-top:10px;
			border-radius: 5px;
			border: none;
			margin-left:20px;
			padding-left:45px;
			outline: none;
			font-family: "微软雅黑";
			font-size: 16px;
		}
		input:nth-of-type(1){
			background: url(img/registerImg/user.jpg) no-repeat 18px center white;
		}
		input:nth-of-type(2){
			background: url(img/registerImg/mima.jpg) no-repeat 18px center white;
		}
		.choose{
			font-size: 14px;
			margin-left:20px;
			margin-top:16px;
		}
		.choose span{
			cursor: pointer;
		}
		.remenber{
			position: relative;
			top:3px;			
		}
		.remPassword:hover{
			color:#f9a61a;
		}
		.forPassword:hover{
			color:#f9a61a;
		}
		.login{
			width:250px;
			height:40px;
			background:#f9a61a;
			margin-left:20px;
			color:white;
			margin-top:20px;
			border: none;
			outline: none;
			border-radius: 8px;
			cursor: pointer;
			font-size: 16px;
			font-weight: 900;
			font-family: "微软雅黑";
		}
		.tab{
			width:300px;
			height:25px;
			position:absolute;
			bottom:0;
			left:150px;			
		}
		.tab span{
			background:#525a65;
			padding:5px 10px;
			border-radius:5px;
			cursor:pointer;	
			color:white;					
		}
		.tab span:nth-of-type(2){
			background:#00aa98;
		}
	</style>
	<script type="text/javascript" src="js/jquery-1.12.4.js" ></script>
	<script type="text/javascript" src="js/resourceList.js" ></script>
	<script type="text/javascript" src="layer-v2.4/layer/layer.js" ></script>
	<script type="text/javascript">
	
	</script>	
	<body>
			航班信息软件著作权
			<header>
				<div class='head'>
					<!-- <p class='text'>库存管理系统</br><span style='font-size: 12px;color:#6d6e72 ;font-weight: normal;'>INVENTORY MANAGEMENT SYSTEM</span></p>
					<p class='register'><span class='picfont'></span><span style='cursor: pointer;'>用户登录</span></p> -->
					<p class='tab'>
						<span class='erpUrl'>ERP系统</span>
						<span>PSS系统</span>
						<span class='pfUrl'>平台系统</span>
					</p>
				</div>
			</header>
			<section>
				<div class='content'>
					<div class='winRegister'>
						<p class='userLogin'>用户登录</br><span style='font-size: 14px;'>USER LOGIN</span></p>
						<input class='user' type='text' placeholder="请输入用户名"/>
						<input class='pw' type='password' placeholder="请输入密码"/>
						
						<p class='choose'><span><input class='remenber' type='checkbox'/></span>&nbsp;&nbsp;<span class='remPassword'>记住密码</span>&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<span class='forPassword'>忘记密码？</span></p>
						<button class='login'>登录</button>
					</div>
				</div>
			</section>
			<footer>
				<p>版权所有&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 天津伊翔运达网络科技有限公司&nbsp;&nbsp;&nbsp; 2017</p>
			</footer>		
	</body>
	
	<script>
			$(".erpUrl").click(function(){
				window.open("http://101.201.102.245:8080/erpnew/admin/index/")
			})
			$(".pfUrl").click(function(){
				window.open("http://www.5efly.com/")
			})
	
	
	
	
			if(getCookie('username')){
			 	$(".user").val(getCookie('username'))
			 	$(".remenber").prop("checked",true)	
			}
			if(getCookie('password')){
				$(".pw").val(getCookie('password'))
			}
			
			
			//________________________________________________________鼠标离开判断用户名
			$(".user").blur(function(){
				if($(".user").val()==""){							
					layer.msg("用户名不能为空！",{icon:2,time:2000})
					return false;
				}
				if($(".user").val()==getCookie('username')){
					$(".pw").val(getCookie('password'))					
				}else{
					$(".pw").val("")
				}
			})			
	
	
	//________________________________________________________点击文字选中复选框
		$(".remPassword").click(function(){
			if(!$(".remenber").is(':checked')){
				$(".remenber").prop("checked",true)			
			}else{
				$(".remenber").prop("checked",false)
			}			
		})
	//________________________________________________________点击登录
		$(".login").click(function(){
			login()			
		})
		document.onkeydown = function(ev){
			ev = ev||event
			if(ev.keyCode=="13"){
				login()
			}
		}
		function login(){
				var loginMess = {};
				var user = $('.user').val();
				var pw = $('.pw').val();
				
				if($(".user").val()==""){
					layer.msg("用户名不能为空！",{icon:2,time:2000})
					return false;
				}
				if($(".pw").val()==""){
					layer.msg("密码不能为空！",{icon:2,time:2000});
					return false;
				}else{
					if($(".remenber").is(':checked')){
						setCookie('username',user,12);
						setCookie('password',pw,12)
					}else{
						//removeCookie('username');
						removeCookie('password');
					}
					loginMess = {
							"loginname":user,
							"password":pw
						}
					$.ajax({
						type:"post",
						url:"api/login?temp="+Math.random(),
						contentType:'application/json;charset=utf-8',
						async:false,
						data:JSON.stringify(loginMess),
						success:function(data){
							data = JSON.parse(data);
							if(data.status=="1001"){
								window.location = "frame.html";
							}else{							
								layer.msg("请输入正确的用户名和密码！",{icon:2,time:2000})
								return false;
							}
															
						}			
					});	
				}
			}
		
//________________________________________________________________________________________忘记密码
   		$(".forPassword").click(function(){
   			layer.msg("请联系管理员重置密码！",{icon:5,time:2000})
   		})
			 
			 
			 
			 
			//设置cookie 
			function setCookie(key,value,t){
				var oDate=new Date();
				oDate.setDate(oDate.getDate()+t);
				document.cookie=key+"="+encodeURI(value)+";expires="+oDate.toGMTString();
			}
			//移除cookie
			function removeCookie(key){
				setCookie(key,"",-10);
			}
			//获取cookie
			function getCookie(key){
				var arr=document.cookie.split("; ");
				for(var i=0;i<arr.length;i++){
					var newArr=arr[i].split("=");
					if(newArr[0]==key){
						return decodeURI(newArr[1]);
					}					
				};
				return false;
			}
	</script>
</html>
